package com.ct.controller.order;


import com.ct.application.order.model.po.OrderQueryPO;
import com.ct.application.order.model.vo.OrderVO;
import com.ct.application.order.service.AdminOrderService;
import com.ct.commons.BaseController;
import com.ct.commons.annotation.PermissionApi;
import com.ct.repository.commons.PageUtils;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 管理后台-订单模块
 *
 * @author system
 * @since 2024-03-26
 */
@RestController
@PermissionApi(title = "订单模块",path="/api/v1/order",code = "F1000",sorted = 5)
public class AdminOrderController extends BaseController {

    @Resource
    private AdminOrderService adminOrderService;


    /**
     * 获取订单列表数据
     */
    @PostMapping("/order/getOrderList")
    @PermissionApi(title = "获取订单列表数据",path="/api/v1/order/getOrderList",code = "F1001",sorted = 1)
    public PageUtils<OrderVO> getOrderList(@Valid @RequestBody OrderQueryPO queryPO) {
        return adminOrderService.getOrderList(queryPO);
    }


    /**
     * 订单详情
     */
    @PostMapping("/order/getOrderDetail")
    public OrderVO getOrderDetail(@Valid @RequestBody OrderQueryPO queryPO) {
        return adminOrderService.getOrderDetail(queryPO);
    }

}


